﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>Index</title>
        @if (false)
    {
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <link href="@Url.Content("~/Content/jquery-ui.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/jquery-ui.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/regex.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)
<script>
    $(document).ready(function () {
        $("#toolMenu").smartFloat();
        var hdjsAlert = $("#e").val();
        if (hdjsAlert != "") {
            alert(hdjsAlert);
        }
    });
    window.onresize = function () { $("#content").attr("height", parent.document.body.clientHeight - 100); }
    function search() {
        $("#hidy").val(year.GetText());
        $("#hids").val(start.GetText());
        $("#hide").val(end.GetText());
        if (year.GetText() != "" && start.GetText() != "" && end.GetText() != "") {
            $("#content").attr("src", rootPath + '/QueryKeyNsrRKQKJDHY/ShowView?y=' + year.GetText() + '&jd1=' + start.GetText() + '&jd2=' + end.GetText());
        } else {
            alert("请正确填写季度！");
        }
    }
    function undo() {

        year.SetValue("");
        start.SetValue("");
        end.SetValue("");
     
    }
    function MenuTop_emClick(source, e) {
        switch (e.item.name) {
            case "btnSave":
                {
                    if ($("#hidy").val() != "" && $("#hids").val() != "" && $("#hide").val() != "") {
                        form1.submit();
                    }
                    else {
                        alert("请选择季度！");
                    }
                    break;
                }
            case "btnReport":
                {
                    document.frames["content"].focus();
                    document.frames["content"].print();
                    break;
                }

        }
    }
    function Editqy() {
        $("#popContent1").attr("src", rootPath + "/Key_NSRXX/Index?report=3");
        codeModalMode1.Show();
    }
    function keyPress() {
        if (event.keyCode && event.keyCode == 13) {
            search();
        }
    }
    function codeCancel1() {
        codeModalMode1.Hide();
    }
</script>
</head>
<body onkeypress="keyPress()">
 @using (Html.BeginForm("ToExecl", "QueryKeyNsrRKQKJDHY", FormMethod.Post, new { id = "form1" }))
 {
     
@Html.Hidden("hidy", "")
@Html.Hidden("hids", "")
@Html.Hidden("hide", "")

@Html.Hidden("e", ViewData["e"])
 }
 @Html.DevExpress().Menu(settings =>
{
    settings.Name = "toolBarMenu";
    settings.ItemAutoWidth = false;
    settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
    settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
    settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
    settings.Items.Add(item =>
    {
        item.Name = "btnSave";
        item.Text = "导出Excel";
        item.Image.Url = Url.Content("~/Content/ControlImages/import.png");
    });

    settings.Items.Add(item =>
    {
        item.Name = "btnReport";
        item.Text = "打印";
        item.Image.Url = Url.Content("~/Content/icons/print.png");
    });
    settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
    settings.ItemLinkMode = ItemLinkMode.ContentBounds;
}).GetHtml()
    <div>
        <table width="100%">
        <tr >
        <td align="center">
        <table><tr>
        <td >
        年份:
        </td>
        <td>
        @Html.DevExpress().TextBox(settings =>
   {
       settings.Name = "year";
       settings.Width = 150;

   }).GetHtml()
        </td>
                <td >
       季度:
        </td>
        <td>
        <table>
        <tr>
        <td>
         @Html.DevExpress().TextBox(settings =>
    {
        settings.Name = "start";
        settings.Width = 150;

    }).GetHtml()
        </td>
        <td>
        -
        </td>
        <td>
         @Html.DevExpress().TextBox(settings =>
    {
        settings.Name = "end";
        settings.Width = 150;

    }).GetHtml()
        </td>
        </tr>
        </table>
       
        </td>
         <td>
                                @Html.DevExpress().Button(settings =>
{
    settings.Name = "btnrpt";
    settings.Text = "编辑企业";
    settings.ControlStyle.CssClass = "button";
    settings.Images.Image.Url = Url.Content("~/Content/FunctionImages/SpecificAdjustManage.png");
    settings.ClientSideEvents.Click = "Editqy";
}).GetHtml()
                            </td>
        <td>
 @Html.DevExpress().Button(settings =>
{
    settings.Name = "btnSearch";
    settings.Text = "查询";
    settings.ControlStyle.CssClass = "button";
    settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
    settings.ClientSideEvents.Click = "search";
}).GetHtml()
        </td>
         <td>
                    @Html.DevExpress().Button(settings =>
               {
                   settings.Name = "btnUndo";
                   settings.Text = "重置";
                   settings.ControlStyle.CssClass = "button";
                   settings.Images.Image.Url = Url.Content("~/Content/ControlImages/undo_blue.png");
                   settings.ClientSideEvents.Click = "undo";
               }).GetHtml()
                </td>
        </tr></table>
        </td>
        </tr>
        </table>
     <div>
     <iframe  id='content' name='content' style='width:100%;' frameborder='0' src=''></iframe>
     </div>
    </div>
    
         
        @Html.DevExpress().PopupControl(
    settings =>
    {
        settings.Name = "codeModalMode1";
        settings.Width = 750;
        settings.Height = 500;
        settings.AllowDragging = true;
        settings.CloseAction = CloseAction.CloseButton;
        settings.EnableAnimation = false;
        settings.HeaderText = "编辑纳税人";
        settings.Modal = true;
        settings.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
        settings.PopupVerticalAlign = PopupVerticalAlign.WindowCenter;
        settings.ShowFooter = true;
        settings.SetFooterTemplateContent(s =>
        {
            ViewContext.Writer.Write("<table align='center'><tr><td>");
           
            @Html.DevExpress().Button(footBtnSettings =>
            {
                footBtnSettings.Name = "btnCancel1";
                footBtnSettings.Text = "关闭";
                footBtnSettings.ClientSideEvents.Click = "codeCancel1";
                footBtnSettings.Images.Image.Url = Url.Content("~/Content/ControlImages/no.png");
                footBtnSettings.CausesValidation = false;
            }).GetHtml();
            ViewContext.Writer.Write("</td></tr></table>");

        });
        settings.SetContent(() =>
        {
            ViewContext.Writer.Write("<iframe  id='popContent1' name='popContent1' style='width:100%;height:500px' frameborder='0' ></iframe>");
        });
    }).GetHtml()
</body>
</html>
